package cn.zn.flow.entity;

import cn.zn.base.bean.entity.BaseEntity;
import cn.zn.oss.entity.FileInfo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 审批流程节点
 * </p>
 *
 * @author zn-admin
 * @since 2021-06-28
 */
@TableName("T_FLOW_NODE")
public class FlowNode extends BaseEntity<FlowNode> {

    /**
     * 主表主键
     */
    @TableField("PARENT_ID")
    private String parentId;

    /**
     * 节点名
     */
    @TableField("NODE_NAME")
    private String nodeName;

    /**
     * 步骤
     */
    @TableField("ORDERS")
    private Integer orders;

    /**
     * 小步骤
     */
    @TableField("SUB_ORDERS")
    private Integer subOrders;

    /**
     * 审批人工号
     */
    @TableField("APPROVER_CODE")
    private String approverCode;

    /**
     * 审批人姓名
     */
    @TableField("APPROVER_NAME")
    private String approverName;

    /**
     * 审批结果：0：不同意； 1：同意
     */
    @TableField("APPROVE_RESULT")
    private String approveResult;

    /**
     * 审批意见
     */
    @TableField("APPROVE_IDEA")
    private String approveIdea;

    /**
     * 接收时间
     */
    @TableField("RECEIVE_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date receiveTime;

    /**
     * 办理完毕时间
     */
    @TableField("DELIVER_TIME")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date deliverTime;

    /**
     * 附件ID
     */
    @TableField("ATTACHMENT_ID")
    private String attachmentId;

    /**
     * 办理状态： 0：未办理； 1：办理中； 2：办理完毕
     */
    @TableField("STATUS")
    private String status;

    /**
     * ERP待办ID
     */
    @TableField("ERP_TODO_ID")
    private String erpTodoId;

    @TableField(exist = false)
    private List<FileInfo> attachments;

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeName(String nodeName) {
        this.nodeName = nodeName;
    }

    public Integer getOrders() {
        return orders;
    }

    public void setOrders(Integer orders) {
        this.orders = orders;
    }

    public Integer getSubOrders() {
        return subOrders;
    }

    public void setSubOrders(Integer subOrders) {
        this.subOrders = subOrders;
    }

    public String getApproverCode() {
        return approverCode;
    }

    public void setApproverCode(String approverCode) {
        this.approverCode = approverCode;
    }

    public String getApproverName() {
        return approverName;
    }

    public void setApproverName(String approverName) {
        this.approverName = approverName;
    }

    public String getApproveResult() {
        return approveResult;
    }

    public void setApproveResult(String approveResult) {
        this.approveResult = approveResult;
    }

    public String getApproveIdea() {
        return approveIdea;
    }

    public void setApproveIdea(String approveIdea) {
        this.approveIdea = approveIdea;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }

    public Date getDeliverTime() {
        return deliverTime;
    }

    public void setDeliverTime(Date deliverTime) {
        this.deliverTime = deliverTime;
    }

    public String getAttachmentId() {
        return attachmentId;
    }

    public void setAttachmentId(String attachmentId) {
        this.attachmentId = attachmentId;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getErpTodoId() {
        return erpTodoId;
    }

    public void setErpTodoId(String erpTodoId) {
        this.erpTodoId = erpTodoId;
    }

    public List<FileInfo> getAttachments() {
        return attachments;
    }

    public void setAttachments(List<FileInfo> attachments) {
        this.attachments = attachments;
    }

    @Override
    public String toString() {
        return "FlowNode{" +
                "parentId=" + parentId +
                ", nodeName=" + nodeName +
                ", orders=" + orders +
                ", approverCode=" + approverCode +
                ", approverName=" + approverName +
                ", approveResult=" + approveResult +
                ", approveIdea=" + approveIdea +
                ", receiveTime=" + receiveTime +
                ", deliverTime=" + deliverTime +
                ", attachmentId=" + attachmentId +
                "}";
    }
}
